package com.nantian.logic.entity.mainEntity.provinceEntity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "province", schema = "springBoot")
public class ProvinceEntity {
    private int id;
    private String province;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "province")
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProvinceEntity that = (ProvinceEntity) o;
        return id == that.id &&
                Objects.equals(province, that.province);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, province);
    }
}
